package com.engineering.elink.util.token;

import java.util.UUID;

/**
 * 令牌生成器
 */
public class TokenGenerator {
	/**
	 * 获取用户种子
	 */
	public static String getSeed(String username) {
		username = username == null ? "" : username;
		String seed = MD5Util.getMD5String(username + "seed");
		return seed;
	}

	/**
	 * 获取登录令牌
	 */
	public static String getToken() {
		UUID uuid = UUID.randomUUID();
		String token = MD5Util.getMD5String(uuid.toString());
		return token;
	}

	/**
	 * 获取验证码令牌(注册业务)
	 */
	public static String getRegVerifyCodeToken(String verifyId) {
		return MD5Util.getMD5String(verifyId);
	}
	

	/**
	 * 获取短信验证码
	 */
	public static String getPhoneVerifyCode (String verifyToken) {
		return MD5Util.getMD5String(verifyToken);
	}
}
